package com.DBConfig;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBUtil {
    private static final String url = "jdbc:mysql://127.0.0.1:3306/erhaizuche";
    private static final String user="root";
    private static final String password="123456";
    private static Connection conn=null;
    static {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn= DriverManager.getConnection(url,user,password);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
    public static Connection getConn(){
        return conn;
    }
}